<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浮动</title>
    <style>
        #container {
            border: 1px solid #000;
           // overflow: hidden;
        }

        #container:after{
            content: '';
            clear: both;
            display: block;
        }
        #container div{
            float: left;
            width: 200px;
            height: 200px;
        }


        #d1{
            background-color: #e0a800;
        }

        #d2 {
            background-color: coral;
        }

        #d3 {
            background-color: #efa2a9;
        }
        #d4 {
            width: 200px;
            height: 200px;
            background-color: #5a6268;
        }
    </style>
</head>
<body>
<div id="container">
    <div id="d1"></div>
    <div id="d2"></div>
    <div id="d3"></div>

    <div class="clear"></div>
</div>

<div id="d4"></div>
</body>
</html>
